/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.oracleandsxnd.erp.purchase.entity;

import com.oracleandsxnd.erp.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;



/**
 * 采购单Entity
 * @author 采购单
 * @version 2019-12-17
 */
public class PurchaseDetail extends DataEntity<PurchaseDetail> {
	
	private static final long serialVersionUID = 1L;
	private String code;		// 商品编码
	private String name;		// 商品名称
	private int amount;		// 数量
	private double price;		// 单价
	private double totalprice;		// 总价格
	private PurchaseOrder purchaseId;		// 销售单id 父类
	private String company;		// 往来单位
	private String companyname;		// 往来单位
	private double lowprice;//最低价
	private double higprice;		//最高价
	private double newprice;//最新价
	private double avgprice;

	public double getAvgprice() {
		return avgprice;
	}

	public void setAvgprice(double avgprice) {
		this.avgprice = avgprice;
	}

	public double getLowprice() {
		return lowprice;
	}

	public void setLowprice(double lowprice) {
		this.lowprice = lowprice;
	}

	public double getHigprice() {
		return higprice;
	}

	public void setHigprice(double higprice) {
		this.higprice = higprice;
	}

	public double getNewprice() {
		return newprice;
	}

	public void setNewprice(double newprice) {
		this.newprice = newprice;
	}

	public String getCompanyname() {
		return companyname;
	}

	public void setCompanyname(String companyname) {
		this.companyname = companyname;
	}
	public PurchaseDetail() {
		super();
	}

	public PurchaseDetail(String id){
		super(id);
	}

	public PurchaseDetail(PurchaseOrder purchaseId){
		this.purchaseId = purchaseId;
	}

	@Length(min=0, max=20, message="商品编码长度必须介于 0 和 20 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=0, max=11, message="商品名称长度必须介于 0 和 11 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}
	
	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}
	
	public double getTotalprice() {
		return totalprice;
	}

	public void setTotalprice(double totalprice) {
		this.totalprice = totalprice;
	}
	
	@Length(min=0, max=32, message="销售单id长度必须介于 0 和 32 之间")
	public PurchaseOrder getPurchaseId() {
		return purchaseId;
	}

	public void setPurchaseId(PurchaseOrder purchaseId) {
		this.purchaseId = purchaseId;
	}
	
	@Length(min=0, max=32, message="往来单位长度必须介于 0 和 32 之间")
	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}
	
}